﻿@model IEnumerable<kxcxw.Data.Entities.SysItemDetial>
@{
    ViewBag.Title = "选择类别";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript" language="javascript">
    $(document).ready(function () {
        $(".root").hover(
            function () {
                $(this).addClass("current");
            },
            function () {
                $(this).removeClass("current");
            }
        );
    });
</script>
<div class="page_content">
<h2>
@if(ViewData["type"].ToString()=="1")
{
    @("网店")
}
else
{
    @("实体店")
}
-选择类别</h2>
@Html.Partial("_StepCtrl", 2)
<br />
<br />
<div style="height: 500px">
    <ul class="categorytree">
        @foreach (kxcxw.Data.Entities.SysItemDetial m in Model.Where(q => q.ItemDeitalPID == null))
        {
            <li class="root">
                @if (Model.Where(q => q.ItemDeitalPID == m.ItemDeitalID).Count() > 0)
                {
                    <a href="javascript:void(0)">@m.itemDetialName</a>
                    <ul class="live2">
                        @foreach (kxcxw.Data.Entities.SysItemDetial m2 in Model.Where(q => q.ItemDeitalPID == m.ItemDeitalID))
                        {
                            <li>
                                @Html.ActionLink(m2.itemDetialName, (ViewData["type"].ToString() == "1") ? "WebShop" : "EntityShop", new { id = m2.ItemDeitalID }, new { @class = "endlink" }) 
                            </li> 
                        }
                    </ul>
                }
                else
                {
                    @Html.ActionLink(m.itemDetialName, (ViewData["type"].ToString() == "1") ? "WebShop" : "EntityShop", new { id = m.ItemDeitalID }, new { @class = "endlink" }) 
                }
            </li>
        }
    </ul>
</div>
</div>